home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.1 KB | 106 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWRecevr.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWFound.hpp"
-
- #ifndef FWRECEVR_H
- #include "FWRecevr.h"
- #endif
-
- #ifndef FWINTSPC_H
- #include "FWIntSpc.h"
- #endif
-
- #ifndef FWINTERE_H
- #include "FWIntere.h"
- #endif
-
- //========================================================================================
- // CLASS FW_MReceiver
- //========================================================================================
-
- FW_DEFINE_CLASS_M0(FW_MReceiver)
- FW_DEFINE_AUTO(FW_MReceiver)
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::FW_MReceiver
- //----------------------------------------------------------------------------------------
-
- FW_MReceiver::FW_MReceiver() :
- fIsConnected(TRUE),
- fReceiverID(0)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::~FW_MReceiver
- //----------------------------------------------------------------------------------------
-
- FW_MReceiver::~FW_MReceiver()
- {
- FW_START_DESTRUCTOR
-
- RemoveAllInterests();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::AddInterest
- //----------------------------------------------------------------------------------------
-
- void FW_MReceiver::AddInterest(const FW_CInterest& interest)
- {
- FW_CPrivInterestSpace::Instance()->AddReceiverInterest(this, interest);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::RemoveAllInterests
- //----------------------------------------------------------------------------------------
-
- void FW_MReceiver::RemoveAllInterests()
- {
- FW_CPrivInterestSpace::Instance()->RemoveReceiver(this);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::RemoveInterest
- //----------------------------------------------------------------------------------------
-
- void FW_MReceiver::RemoveInterest(const FW_CInterest& interest)
- {
- FW_CPrivInterestSpace::Instance()->RemoveReceiverInterest(this, interest, true);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::Connect
- //----------------------------------------------------------------------------------------
-
- void FW_MReceiver::Connect()
- {
- if (!fIsConnected)
- {
- fIsConnected = true;
- FW_CPrivInterestSpace::Instance()->SetReceiverIsConnected(this, true);
- }
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::Disconnect
- //----------------------------------------------------------------------------------------
-
- void FW_MReceiver::Disconnect()
- {
- if (fIsConnected)
- {
- fIsConnected = false;
- FW_CPrivInterestSpace::Instance()->SetReceiverIsConnected(this, false);
-
- }
- }
-